import 'package:flutter/material.dart';
import '../../pages/Tabs.dart';

class RegisterThirdPage extends StatelessWidget {
  const RegisterThirdPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("注册第三步"),
      ),
      body: Column(
        children: <Widget>[
          Text("这是注册3界面"),
          RaisedButton(
            onPressed: () {
              // Navigator.pushNamed(context, '/registersecond');
              // Navigator.of(context)
              //     .pushReplacementNamed('/registersecond'); //页面替换
              // Navigator.of(context).pop();
              //返回根目录
              Navigator.of(context).pushAndRemoveUntil(
                  new MaterialPageRoute(
                      builder: (context) => new Tabs(index: 2)),
                  (route) => route == null);
            },
            child: Text("确定"),
          ),
        ],
      ),
    );
  }
}
